<?php 
include TMPL_PATH.'public/header.phtml';
?>
<div class="subnav">
    <div class="content-menu ib-a blue line-x">
        <a href='javascript:;' class="on"><em>会员等级管理</em></a><span>|</span><a href='javascript:add();' ><em>添加会员等级</em></a>    </div>
</div>
<div class="pad_10">
<div class="table-list">
    <table width="100%" cellspacing="0">
      <thead>
				<tr>
				<th width="10%" align="center">ID</th>
				<th width="10%" align="left" >等级名</th>
				<th width="10%" align="center" >折扣率</th>
				<th width="10%"  align="center" >最小经验值</th>
				<th width="10%"  align="center" >最大经验值</th>
				<th width="10%" >管理操作</th>
				</tr>
      </thead>
     <tbody>
        <?php 
        if(isset($rankList) && $rankList):
        	foreach ($rankList as $v):
        ?>
			<tr>
				<td width="10%" align="center"><?php echo $v['id']?></td>
				<td width="10%" ><?php echo $v['name']?></td>
				<td width="10%" align="center"><?php echo $v['discount']?>%</td>
				<td width="10%" align="center"><?php echo $v['min_point']?></td>
				<td width="10%" align="center"><?php echo $v['max_point']?></td>
				<td width="10%"  align="center">
				<a href="javascript:edit(<?php echo $v['id']?>, '<?php echo $v['name']?>')">修改</a> | 
				<a href="javascript:confirmurl('<?php echo U('user/rank_delete','rid='.$v['id'])?>', '是否删除该等级?')">删除</a>
				</td>
			</tr>
			<?php 
					endforeach;
				endif;
			?>
		</tbody>
	</table>
</div>
</div>
</body>
</html>
<script type="text/javascript">
<!--
	function edit(id, name) {
		window.top.art.dialog({title:'修改--'+name, id:'edit', iframe:'<?php echo U('user/rank_edit');?>&rid='+id ,width:'600px',height:'400px'}, 	function(){var d = window.top.art.dialog({id:'edit'}).data.iframe;
		var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'edit'}).close()});
	}
function add() {
	window.top.art.dialog({title:'添加--会员等级', id:'add', iframe:'<?php echo U('user/rank_add');?>' ,width:'600px',height:'400px'}, 	function(){var d = window.top.art.dialog({id:'add'}).data.iframe;
	var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'add'}).close()});
}
//-->
</script>